import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/css/normalize.css';
import '@/assets/css/reset.css';
Vue.use(ElementUI);
// 关闭生产环境的提示信息
//全局的日期过滤器
Vue.filter('formater', function(d){
  let d1 = new Date(d);
  return d1.getFullYear()+'/'+(d1.getMonth()+1)+'/'+d1.getDate();
});

Vue.filter('sfm', function(d){
  let now = new Date(d);
  let hour = now.getHours();
  let minute = now.getMinutes();
  let second = now.getSeconds();
  return hour+':'+minute+':'+second;
});



Vue.filter("datetime", (d) => {
	let d1 = new Date(d);
	let year = d1.getFullYear();//年
	let month = ("0" + (d1.getMonth() + 1)).slice(-2);//月
	let day = ("0" + d1.getDate()).slice(-2);//日
	let hour = ("0" + d1.getHours()).slice(-2);//时
	let minute = ("0" + d1.getMinutes()).slice(-2);//分
	let second = ("0" + d1.getSeconds()).slice(-2);//秒

	// 格式化输出
	return (
		year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second
	);
});
// 设置一个总线，用于组件之间传递参数

Vue.prototype.$bus=new Vue();
Vue.config.productionTip = false //关闭生产环境提示
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
